package by.exposit.dao;

import by.exposit.dao.entity.FieldEntity;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
@Repository
@Transactional
public class FieldDAOImpl extends GenericDAOImpl<FieldEntity,Long> implements FieldDAO {

          @Override
    public FieldEntity retrieveSphere(long fieldId) {
              Criteria cr = getSession()
                      .createCriteria(FieldEntity.class, "Field")
                      .add(Restrictions.eq("fieldId", fieldId));
              return (FieldEntity)cr.uniqueResult();
    }
}
